package com.gupt.youhd.controller;
/*
@author name
@data 2023/4/15-11:45
*/


import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.gupt.youhd.config.AlipayConfig;
import com.gupt.youhd.qo.PayQo;
import com.gupt.youhd.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

//新建一个PayController类,编写一个用于支付的接口/pay

@RestController
public class PayController {

    @Autowired
    private PayService payService;

    @RequestMapping("/pay")
    public void payController(HttpServletResponse response, @RequestBody PayQo qo) throws IOException {
      payService.pay(response,qo);
    }
}